package com.tobehonor.kafkademo.consumer;

import com.alibaba.fastjson.JSON;
import lombok.extern.slf4j.Slf4j;
import org.apache.kafka.clients.consumer.ConsumerRecord;
import org.springframework.kafka.annotation.KafkaListener;
import org.springframework.stereotype.Component;

@Slf4j
@Component
public class SimpleConsumer {

    @KafkaListener(topics = {"sub_topic"})
    public void onNormalMessage(String message) {
      log.info("消费的消息: {}", JSON.toJSONString(message));
    }
}
